package com.itany.hotel.service.impl;

import com.itany.hotel.constants.Constants;
import com.itany.hotel.dao.CategoryMapper;
import com.itany.hotel.dao.MemberMapper;
import com.itany.hotel.entity.Category;
import com.itany.hotel.entity.Member;
import com.itany.hotel.entity.Room;
import com.itany.hotel.service.RoomService;
import framework.bean.factory.ObjectFactory;

import java.util.Date;
import java.util.List;

public class RoomServiceImpl implements RoomService {
    @Override
    public List<Category> findCategories() {

        CategoryMapper categoryDao= (CategoryMapper) ObjectFactory.getObject("categoryMapper");

        return categoryDao.selectAll();
    }

    @Override
    public List<Room> findAvailable(Integer categoryId, Integer resideType, Date startDate, Date endDate) {

        //整间预定
        if(Constants.ResideType.RESIDE_TYPE_ROOM.equals(resideType)){
            //调用持久层整间预定查询
        }

        //床位预定
        if(Constants.ResideType.RESIDE_TYPE_BED.equals(resideType)){
            //调用持久层床位预定查询
        }



        return null;
    }
}
